﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Hxsoft.AppV1.Admin.LinkManage.Default" %>

<%@ Register Src="~/Controls/ListBox_FootBox.ascx" TagName="ListBox_FootBox" TagPrefix="uc" %>
<%@ Register Src="~/Controls/ListBox_HeadBox.ascx" TagName="ListBox_HeadBox" TagPrefix="uc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
	<title>链接管理</title>

	<script type="text/javascript" src="<%# ResolveUrl("~/J/List.js") %>"></script>

	<script type="text/javascript" src="../CommonPage/J/Controller.js"></script>

	<script language="javascript" type="text/javascript">
	<!--
        function ReloadPage() {
            var btReload = document.getElementById("<%# BtReload.ClientID %>");
            if (btReload)
                btReload.click();
        }
        function MoveLinkItem(selectObj, linkName, linkId) {
            FormatGrade();
            var obj = $("#<%# HddLinkId.ClientID %>");
            obj.val(linkId.toString());

            var InputObj = document.getElementById("InputDiv");
            InputObj.className = "ShowListDiv";
            var companyNameSpan = document.getElementById("SetLinkName");
            if (linkName == '')
                companyNameSpan.innerHTML = "批量移动链接项";
            else
                companyNameSpan.innerHTML = "移动链接项[<span class='red'>" + linkName + "</span>]";

            var pos = getElementPos(selectObj);
            var left = pos.x - InputObj.offsetWidth;

            InputObj.style.top = "10px";
            InputObj.style.left = left.toString() + "px";

            var gradeVID = document.getElementById("GradeDIV");
            gradeVID.className = "ShowGradeDIV";

            $('#GradeDIV').height($(document).height() + "px");
            $('#GradeDIV').width($(document.body).outerWidth(true) + "px");
        }

        function FormatGrade() {
            var obj = $("#<%# HddLinkId.ClientID %>");
            obj.val("");
        }

        function CloseDiv() {
            var InputObj = document.getElementById("InputDiv");
            InputObj.className = "hideMe";
            var companyNameSpan = document.getElementById("SetLinkName");
            companyNameSpan.innerHTML = "";
            var gradeVID = document.getElementById("GradeDIV");
            gradeVID.className = "hideMe";

            $('#GradeDIV').height("0px");
            $('#GradeDIV').width("0px");

            FormatGrade();
        }	
        
	-->
	</script>

</head>
<body>
	<form id="form1" runat="server">
	<asp:ScriptManager ID="ScriptManager1" runat="server">
	</asp:ScriptManager>
	<div id="MainBody" runat="server">
		当前位置: 管理中心 →[<%= SiteName %>→<%= ClassName%>] 链接管理
		<uc:ListBox_HeadBox ID="ListBox_HeadBox1" runat="server" />
		<div class="ListBoxItem">
			<table id="ToolBarBox" cellspacing="0" width="100%">
				<tr>
					<td class="LevelCompart" align="right">
						<input type="button" class="Button" value="全选" onclick="SelectAllInner(&quot;List&quot;, &quot;&quot;);" />
						<input type="button" class="Button" value="反选" onclick="SelectReverseInner(&quot;List&quot;, &quot;&quot;);" />
						|
						<input type="submit" id="BtSeffiective" value="设置状态" runat="server" class="Button"
							onclick="return confirm(&quot;是否设置选定的信息的状态？&quot;);" onserverclick="BtSeffiective_ServerClick" />
						<input type="submit" id="BtDelete" value="删除" runat="server" class="Button" onserverclick="BtDelete_ServerClick"
							onclick="return confirm(&quot;是否删除选定的信息？&quot;);" />
						<input class="Button" onclick="javascript:OpenWindowCenter(&quot;AddLink.aspx?ClassID=<%# ClassID %>&SiteId=<%# SiteId %>&quot;);"
							type="button" value="添加" />
						<input class="Button" onclick="MoveLinkItem(this,&quot;&quot;,&quot;&quot;);" value="移动"
							type="button" />
					</td>
				</tr>
				<tr>
					<td id="Foot">
						关键字:<asp:TextBox ID="TbKeyword" runat="server"></asp:TextBox>
						频道:<Hxctr:DicSelector runat="server" ID="CtrChannelIds" ClassCode="<%# Hxsoft.AppV1.Module.Common.DicClassName_ChannelCategory %>"
							SiteId="<%# SiteId %>" />
						<asp:Button ID="BtSearch" runat="server" Text="搜索" OnClick="BtSearch_Click" />
						|
						<asp:Button ID="BtReload" runat="server" Text="刷新" OnClick="BtReload_Click" />
					</td>
				</tr>
			</table>
		</div>
		<div class="ListBoxItem">
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
				<ContentTemplate>
					<table id="ListBox" cellspacing="0" width="100%">
						<tbody>
							<tr>
								<td class="LevelCompart">
									<asp:Repeater ID="List" runat="server" OnItemCommand="List_ItemCommand">
										<HeaderTemplate>
											<table id="List" cellspacing="1" cellpadding="2" width="100%">
												<tr id="Title">
													<th width="40">
														[ID]
													</th>
													<th>
														标题
													</th>
													<th width="40">
														排序
													</th>
													<th width="120">
														起始时间
													</th>
													<th width="120">
														结束时间
													</th>
													<th width="40">
														有效
													</th>
													<th>
														所属频道
													</th>
													<th>
														修改|删除|移动
													</th>
													<th width="40">
														选择
													</th>
												</tr>
										</HeaderTemplate>
										<ItemTemplate>
											<tr class="mouseout" align="center" onmouseover="listItem_mouseOver(this);" onmouseout="listItem_mouseOut(this);">
												<td>
													<%# Eval("LinkID") %>
												</td>
												<td>
													<%# Eval("Title") %>
												</td>
												<td>
													<%# Eval("OrderNumber")%>
												</td>
												<td>
													<%# Eval("StartDate") %>
												</td>
												<td>
													<%# Eval("EndDate") %>
												</td>
												<td>
													<asp:LinkButton ID="LbtSetEffectiveState" CommandName="SetEffective" OnClientClick="return confirm(&quot;是否更改该信息的有效状态？&quot;);"
														runat="server"><%# (bool)Eval("IsEffective") == true ? "是" : "<span class=\"Emphasize\">否</span>"%></asp:LinkButton>
												</td>
												<td>
													<%# ItemChannels %>
												</td>
												<td>
													<a href="javascript:void(0);" onclick='javascript:OpenWindowCenter("ModifyLink.aspx?LinkID=<%# Eval("LinkID") %>&SiteId=<%# SiteId %>");'>
														修改</a>
													<asp:LinkButton ID="LbtDelete" CommandName="Delete" OnClientClick="return confirm(&quot;是否删除该信息？&quot;);"
														runat="server">删除</asp:LinkButton>
													<a href="javascript:void(0);" onclick="MoveLinkItem(this,&quot;<%# Eval("Title") %>&quot;,&quot;<%# Eval("LinkID") %>&quot;);">
														移动</a>
												</td>
												<td>
													<asp:CheckBox ID="CbSelect" runat="server" />
													<asp:HiddenField ID="Identifier_LinkID" Value='<%# Eval("LinkID") %>' runat="server" />
												</td>
											</tr>
										</ItemTemplate>
										<FooterTemplate>
											</table>
										</FooterTemplate>
									</asp:Repeater>
								</td>
							</tr>
							<tr>
								<td id="Td1" align="right">
									<Hxctr:AspNetPager ID="pager" runat="server" AlwaysShow="True" OnPageChanging="pager_PageChanging"
										CustomInfoSectionWidth="" CustomInfoText="" PageSize="20" ShowCustomInfoSection="Left">
									</Hxctr:AspNetPager>
								</td>
							</tr>
						</tbody>
					</table>
				</ContentTemplate>
				<Triggers>
					<asp:AsyncPostBackTrigger ControlID="BtDelete" EventName="ServerClick" />
					<asp:AsyncPostBackTrigger ControlID="BtReload" EventName="Click" />
					<asp:AsyncPostBackTrigger ControlID="BtSearch" EventName="Click" />
					<asp:AsyncPostBackTrigger ControlID="BtMove" EventName="ServerClick" />
					<asp:AsyncPostBackTrigger ControlID="BtCopyAndMove" EventName="ServerClick" />
				</Triggers>
			</asp:UpdatePanel>
		</div>
		<uc:ListBox_FootBox ID="ListBox_FootBox1" runat="server" />
	</div>
	<div class="" id="GradeDIV" onmousedown="CloseDiv();">
	</div>
	<div id="InputDiv" class="hideMe">
		<div class="InputDivHeader">
			<h6 style="border-bottom: 1px solid #ccc;">
				<img alt="关闭" src="../../I/del.gif" onclick="CloseDiv();" />
				<span id="SetLinkName"></span>
			</h6>
		</div>
		<div class="gradeSelect">
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
				<tr>
					<td style="width: 85px; text-align: right; vertical-align: top;">
						选择目标模块：
					</td>
					<td style="text-align: left;">
						<div style="text-align: center;">
							<a id="ShowMainMenuButton" href="javascript:void(0);"></a>
						</div>
						<asp:UpdatePanel ID="UpdatePanel2" runat="server">
							<ContentTemplate>
								<asp:TreeView ID="LinkClassView" runat="server" NodeIndent="10" ShowLines="True"
									OnTreeNodePopulate="LinkClassView_TreeNodePopulate" ExpandDepth="0" ShowCheckBoxes="Leaf">
								</asp:TreeView>
							</ContentTemplate>
							<Triggers>
								<asp:AsyncPostBackTrigger ControlID="BtDelete" EventName="ServerClick" />
								<asp:AsyncPostBackTrigger ControlID="BtReload" EventName="Click" />
								<asp:AsyncPostBackTrigger ControlID="BtSearch" EventName="Click" />
								<asp:AsyncPostBackTrigger ControlID="BtMove" EventName="ServerClick" />
								<asp:AsyncPostBackTrigger ControlID="BtCopyAndMove" EventName="ServerClick" />
							</Triggers>
						</asp:UpdatePanel>
					</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align: center;">
						<input id="BtMove" type="submit" value="复制链接项" runat="server" onserverclick="BtMove_Click"
							class="Button" causesvalidation="true" onclick="return confirm('是否移动所选择的链接项到指定的链接?');" />
						<input id="BtCopyAndMove" type="submit" value="复制并移除链接项" runat="server" onserverclick="BtCopyAndMove_Click"
							class="Button" causesvalidation="true" onclick="return confirm('是否移动所选择的链接项到指定的链接并移除当前链接?');" />
					</td>
				</tr>
			</table>
		</div>
	</div>
	<Hxctr:MessageBox ID="MessageBox1" runat="server" />
	<Hxctr:UpdateProgress ID="UpdateProgress1" runat="server" />
	<asp:HiddenField ID="HidIds" runat="server" />
	<asp:HiddenField ID="HddLinkId" runat="server" />
	</form>
</body>
</html>
